package com.fis.mca.client;

import java.net.MalformedURLException;
import java.net.URL;

import javax.xml.namespace.QName;

import com.fis.mca.action.ActionTransferer;
import com.fis.mca.action.ActionTransfererService;
import com.fis.mca.config.Config;
import com.fis.mca.config.ConfigConstant;

public class ActionTransfererClient
{
	private static final QName SERVICE_NAME = new QName("http://action.mca.fis.com/", "ActionTransfererService");
	private static final String WSDL_URL = Config.getURL(ConfigConstant.ACTION_PORT_KEY);
	private static final ActionTransferer port;
	private static final ActionTransfererService ss;
	
	private ActionTransfererClient()
	{
		
	}

	static
	{
		URL url = null;
		try
		{
			url = new URL(WSDL_URL);
		}
		catch (MalformedURLException e)
		{
			java.util.logging.Logger
					.getLogger(ActionTransfererService.class.getName())
					.log(java.util.logging.Level.INFO,
							"Can not initialize the default wsdl from {0}",
							WSDL_URL);
		}
		
		ss = new ActionTransfererService(url, SERVICE_NAME);
		port = ss.getActionTransfererPort();
	}
	
	public static ActionTransferer getService()
	{
		return port;
	}
	
}
